import 'dart:ffi';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ladder_cash/config/super_theme.dart';

Widget getLinerText(
  String text,
{Color startColor = Colors.white,Color endColor =  SuperTheme.primary,double fontSize = 25.0,Color borderColor = Colors.black,String fontFamily = 'italic'}
) {
  return  Stack(
    alignment: Alignment.center,
    children: [
      ShaderMask(
        shaderCallback: (Rect bounds) {
          return LinearGradient(
            begin: Alignment.topCenter,
            end: Alignment.bottomCenter,
            colors: [startColor, endColor],
          ).createShader(Offset.zero & bounds.size);
        },
        child: Text(
          text,
          style: TextStyle(
            fontFamily: fontFamily,
              fontSize: fontSize,
              height: 1.0,
              fontWeight: FontWeight.bold,
              foreground: Paint()
                ..style = PaintingStyle.stroke
                ..strokeWidth = 2
                ..color = borderColor),
        ),
      ),
      ShaderMask(
        shaderCallback: (Rect bounds) {
          return LinearGradient(
            begin: Alignment.topCenter,
            end: Alignment.bottomCenter,
            colors: [startColor, endColor],
          ).createShader(Offset.zero & bounds.size);
        },
        child: Text(
         text,
          style: TextStyle(
            fontFamily: fontFamily,
              color: startColor,
              fontSize: fontSize,
              height: 1.0,
              fontWeight: FontWeight.bold),
        ),
      )
    ],
  );
}
